Skip to content

fix(pylock): respect an explicitly empty tag sequence in select() - #1349

Merged
henryiii merged 1 commit into
pypa:mainfrom
r266-tech:fix/pylock-empty-tags
Jul 25, 2026
Merged

fix(pylock): respect an explicitly empty tag sequence in select()#1349
henryiii merged 1 commit into
pypa:mainfrom
r266-tech:fix/pylock-empty-tags

Conversation

@r266-tech

Copy link
Copy Markdown
Contributor

Pylock.select(tags=[]) currently treats the explicit empty sequence like an omitted argument and falls back to the running interpreter's sys_tags(). That can select a host-compatible wheel even when the caller supplied no compatible tags.

This changes the defaulting check to distinguish None from an explicit empty sequence:

  • an empty tag sequence falls back to an available sdist;
  • a wheel-only lock raises PylockSelectError;
  • omitted tags and non-empty tag sequences retain their existing behavior.

Tests: PYTHONPATH=src python3 -m pytest -q tests/test_pylock_select.py (27 passed).

@henryiii
henryiii requested a review from sbidoul July 24, 2026 19:43
@henryiii
henryiii merged commit 826426f into pypa:main Jul 25, 2026
69 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants